package com.ujoku.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.labillusion.core.util.jsonFormat.SimpleDateSerializer;
import com.labillusion.core.util.jsonFormat.SimpleDoubleSerializer;

import java.util.Date;

/**
 * Created by Andy.Lian on 2014/11/4.
 */
public class OrderItem {
    private String id;
    private String cartItemId;
    private String orderId;
    private int goodsId;
    private String goodsName;
    private int qty;
    @JsonSerialize(using = SimpleDoubleSerializer.class)
    private Double price;
    @JsonSerialize(using = SimpleDoubleSerializer.class)
    private Double goodsPrice;
    @JsonSerialize(using = SimpleDoubleSerializer.class)
    private Double total;

    private String smallImage;

    private String myListItemId;

    @JsonIgnore
    private Date goodsUpdateTime;

    @JsonSerialize(using = SimpleDateSerializer.class)
    private Date updateTime;

    public Date getGoodsUpdateTime() {
        return goodsUpdateTime;
    }

    public void setGoodsUpdateTime(Date goodsUpdateTime) {
        this.goodsUpdateTime = goodsUpdateTime;
    }

    public String getMyListItemId() {
        return myListItemId;
    }

    public void setMyListItemId(String myListItemId) {
        this.myListItemId = myListItemId;
    }

    public String getSmallImage() {
        return smallImage;
    }

    public void setSmallImage(String smallImage) {
        this.smallImage = smallImage;
    }

    public Double getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(Double goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCartItemId() {
        return cartItemId;
    }

    public void setCartItemId(String cartItemId) {
        this.cartItemId = cartItemId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public int getQty() {
        return qty;
    }

    public void setQty(int qty) {
        this.qty = qty;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getTotal() {
        return total;
    }

    public void setTotal() {
        this.total = this.price * this.qty;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
